package com.jiyang.jyandroid.test01;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.jiyang.jyandroid.BaseActivity;
import com.jiyang.jyandroid.R;

/**
 * Created by jy on 2016/10/24.
 * 使用ArrayAdapter创建ListView
 */

public class One_7Activity extends BaseActivity {


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test01_4);
        ListView listView = (ListView) findViewById(R.id.list);
        String[] text = new String[]{"Android", "Java", "C++", "数字媒体技术", "我们学校", "计算机学院"};
        ArrayAdapter<String> stringArrayAdapter = new ArrayAdapter<>(this, R.layout.item_test01_4, text);
        listView.setAdapter(stringArrayAdapter);
    }
}
